package com.sync.platform.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * Database configuration entity
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("database_config")
public class DatabaseConfig extends BaseEntity {

    /**
     * Database name (for display)
     */
    @TableField("name")
    private String name;

    /**
     * Database type (MySQL, PostgreSQL, etc.)
     */
    @TableField("db_type")
    private String dbType;

    /**
     * Server ID (optional, if this database is associated with a server)
     */
    @TableField("server_id")
    private Long serverId;

    /**
     * Database host
     */
    @TableField("host")
    private String host;

    /**
     * Database port
     */
    @TableField("port")
    private Integer port;

    /**
     * Database name to connect to
     */
    @TableField("database_name")
    private String databaseName;

    /**
     * Database username
     */
    @TableField("username")
    private String username;

    /**
     * Database password
     */
    @TableField("password")
    private String password;

    /**
     * JDBC connection URL
     */
    @TableField("url")
    private String url;

    /**
     * JDBC driver class
     */
    @TableField("driver_class")
    private String driverClass;

    /**
     * Database character set
     */
    @TableField("charset")
    private String charset;

    /**
     * Optional description
     */
    @TableField("description")
    private String description;

    /**
     * Database connection status (0: disconnected, 1: connected)
     */
    @TableField("status")
    private Integer status;
}
